Skip to main content

All Questions

Tagged with
6votes
2answers
503views

Means square displacement (MSD)

I have written a code to calculate the MSD of some molecules. The code averages over multiple time origins (sliding time window) and over all the molecules. I have also made it do one extra thing: do ...
mjksho's user avatar
2votes
2answers
2kviews

Solving the TDoA multilateration problem in 3-dimensions

Background. I've written an algorithm to solve the Time Difference of Arrival (TDoA) multilateration problem in 3-dimensions. That is, given the known coordinates of ...
10GeV's user avatar
1vote
1answer
503views

Solving a 3D heat diffusion PDE

I am trying to solve a heat diffusion type PDE using a finite difference method. I would like to preface that I have seriously simplified the code. Just so that anyone who tries to help me, doesn't ...
Ruan's user avatar
  • 111
4votes
1answer
424views

Path of a particle in a non-uniform B field

I have completed my project which simulates the path of a particle trapped in a device known as a magnetic mirror. I would like your thoughts and improvements on my implementation. Here is the code: <...
Dila's user avatar
  • 215
1vote
2answers
201views

Better way to calculate double-scattering diffraction using cartesian product of arrays?

This script calculates points in reciprocal space for hexagonal 2D lattices, then uses the cartesian product from itertools to add each vector from one lattice to all of the vectors of the other in ...
uhoh's user avatar
  • 593
3votes
1answer
1kviews

N-Body Gravitational Simulation of Point-Masses in Python

I made an n-body gravitational simulation in python. The algorithm does produce an approximate solution, which is shown at the bottom of the post. Additional methods to produce animations (among other ...
user avatar
3votes
1answer
288views

Optical dispersion calculation from spectrograms with Python

First, I'd like to provide a little explanation on what my code is supposed to do. It is part of a middle-sized project. I restructured the code to work on its own, and also added little comments to ...
Péter Leéh's user avatar
4votes
2answers
2kviews

Trapezoidal rule for set of data

Here is the question from the book of Mark Newman-Computational Physics Exc 5.1 a) Read in the data and, using the trapezoidal rule, calculate from them the approximate distance traveled by the ...
camarman's user avatar
4votes
1answer
810views

Gravity simulation using Numpy and Pygame

This is a simple gravity simulator coded in Python 3.7 using Numpy and Pygame. I was wondering if it can be optimized further. Initially I had coded it using pure Python lists, using nested loops to ...
user186567's user avatar
1vote
1answer
260views

Modeling a capacitor with DC Bias

I am modeling a capacitor which has its capacitance varying according to the DC Bias. The DC Bias is computed by taking the mean of the voltage across the capacitance. ...
Mathieu's user avatar
5votes
1answer
205views

Calculating a table of deBroglie wavelengths for various electron energies

Here is the formula for the deBroglie wavelength of an electron versus its kinetic energy: $$ \lambda(E_k) = h\left/\sqrt{\frac{(E_k+m_eC^2)^2-m_e^2C^4}{C^2}}\right.$$ and here is simple script that ...
Christian Chapman's user avatar
4votes
1answer
1kviews

Snell's law using Zoeppritz equation by matrices

I have created the following code to calculate Snell's law angles, based on Zoeppritz equations on complex plane. The code works, seems it is returning valid values, but after all the code just looks ...
Lin's user avatar
  • 295
2votes
2answers
5kviews

Simulation of 2D elastic balls

Following this SO post and this Wikipedia article, I wrote a Python script to simulate physics of 2D elastic balls. I define the physical behaviour of each ball in the ...
cromod's user avatar
3votes
3answers
603views

Creating and manipulating FITS files

I wrote a program that manipulated data from VLA observations and created FITS files to be used in creating spectral energy distributions of high redshift radio galaxies. I really tried to be as ...
Joseph Farah's user avatar
15votes
3answers
5kviews

Orbital Trajectory simulator

I have written a simple program to do trajectory simulation in the Earth-Moon system, it still has a long way to go I am working on making it more class oriented and am looking into implementing a ...
Mark Omo's user avatar

153050per page
close